if($ucp_on!=true OR isset($_GET['ucp_on'])){ die("
U heeft hier geen toegang.
"); }
include 'config.php';
if(isset($_GET['start']) && $_GET['start']>=1)
{
$start=(($_GET['start']-1)*20);
}
else
{
$start=0;
}
$qy3=mysqli_query($mysqli_connection, "SELECT * FROM dst_news_content WHERE categorie='".$_REQUEST['categorie']."' AND actief='1' ORDER BY datum DESC LIMIT ".$start.", 20");
$rs3=mysqli_num_rows($qy3);
if($rs3==0)
{
if($_REQUEST['categorie']!='cat')
{
header("Location: http://www.desterren.net/404/");
}
else
{
$titel='Nieuws Categorieën';
include "inc/header.php";
?>
Bekijk nieuws per categorieën
}
}
else
{
$sql=mysqli_query($mysqli_connection, "SELECT * FROM dst_news_content WHERE categorie='".$_REQUEST['categorie']."' AND actief='1' ORDER BY datum DESC LIMIT 1");
while($ob3=mysqli_fetch_object($sql))
{
$categorie=$ob3->categorie;
}
$sql=mysqli_query($mysqli_connection, "SELECT * FROM dst_news_cat WHERE cat='".$categorie."'");
while($row=mysqli_fetch_array($sql))
{
$titel2=$row['categorie']." :: Nieuws Categorieën";
$titel="Categorie: ".$row['categorie'];
}
include "inc/header.php";
include "inc/ftie_bbcode.php";
?>
while($ob3=mysqli_fetch_object($qy3))
{
$titel=$ob3->titel;
$content=$ob3->content;
$datum=$ob3->datum;
$userid=$ob3->user_id;
$categorie=$ob3->categorie;
$pg_id=$ob3->id;
$kortetitel=$ob3->kortetitel;
$sqll=mysqli_query($mysqli_connection, "SELECT * FROM dst_users WHERE id='".$userid."'");
while($roww=mysqli_fetch_array($sqll))
{
$fullname=$roww['fullname'];
}
list($date,$time)=explode(' ',$datum);
list($year,$month,$day)=explode('-',$date);
list($hours,$minutes,$seconds)=explode(':',$time);
include "inc/maand2.php";
$content = preg_replace("#\[h\](.*?)\[/h\]#si","",$content);
$content = preg_replace("#\[center\](.*?)\[/center\]#si","\\1
",$content);
$content = preg_replace("#\[b\](.*?)\[/b\]#si","\\1",$content);
$content = preg_replace("#\[u\](.*?)\[/u\]#si","\\1",$content);
$content = preg_replace("#\[i\](.*?)\[/i\]#si","\\1",$content);
$content = preg_replace("#\[url=(.*?)\](.*?)\[/url\]#si","\\2",$content);
$content = str_replace("
","",$content);
$content = str_replace("","",$content);
$content = str_replace("[p]","",$content);
$content = str_replace("[/p]","",$content);
$content = preg_replace("#\(.*?)
#si","\\1
",$content);
$content = preg_replace("#\
(.*?)
#si","\\1
",$content);
$content = preg_replace('#\[img(.*?)\[/img\]#si','',$content);
$content=substr($content,0,360);
$q2=mysqli_query($mysqli_connection, "SELECT * FROM dst_news_cat WHERE cat='".$categorie."'");
while($o2=mysqli_fetch_object($q2))
{
$image=$o2->img;
}
?>
echo '
Geplaatst op '.$day.' '.strtolower($namemonth).' '.$year.' om '.$hours.'u'.$minutes.'
door '.$fullname; ?>
if(isset($user_login) && $user_login==1 && ($userid==$user_id OR $user_rank==1)){ echo ' - Wijzig'; } ?>
echo $content; ?>...
Lees meer »
}
$tbl_name="nieuws";
$adjacents = 3;
$query = "SELECT COUNT(*) as num FROM dst_news_content WHERE categorie='".$_REQUEST['categorie']."' AND actief='1'";
$total_pages = mysqli_fetch_array(mysql_query($query));
$total_pages = $total_pages['num'];
$limit = 20;
if(isset($_GET['start'])){ $page = $_GET['start']; } else { $page = 0; }
if($page==0){ $page=1; }
if($page && $page>=1)
{
$start = ($page - 1) * $limit;
}
else
{
$start = 0;
$page=1;
}
$sql = "SELECT * FROM dst_news_content WHERE categorie='".$_REQUEST['categorie']."' AND actief='1' ORDER BY datum DESC LIMIT ".$start.", ".$limit;
$result = mysql_query($sql);
if($page == 0){ $page = 1; }
$prev = $page - 1;
$next = $page + 1;
$lastpage = ceil($total_pages/$limit);
$lpm1 = $lastpage - 1;
$pagination = "";
if($lastpage > 1)
{
if ($page > 1)
{
$pagination.= "« vorige | ";
}
else
{
$pagination.= "« vorige | ";
}
if ($lastpage < 7 + ($adjacents * 2)) //not enough pages to bother breaking it up
{
for ($counter = 1; $counter <= $lastpage; $counter++)
{
if ($counter == $page)
{
$pagination.= "$counter | ";
}
else
{
$pagination.= "$counter | ";
}
}
}
elseif($lastpage > 5 + ($adjacents * 2)) //enough pages to hide some
{
if($page < 1 + ($adjacents * 2))
{
for($counter = 1; $counter < 4 + ($adjacents * 2); $counter++)
{
if ($counter == $page)
$pagination.= "$counter | ";
else
$pagination.= "$counter | ";
}
$pagination.= "... | ";
$pagination.= "$lpm1 | ";
$pagination.= "$lastpage | ";
}
elseif($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))
{
$pagination.= "1 | ";
$pagination.= "2 | ";
$pagination.= "... | ";
for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)
{
if($counter == $page)
{
$pagination.= "$counter | ";
}
else
{
$pagination.= "$counter | ";
}
}
$pagination.= "... | ";
$pagination.= "$lpm1 | ";
$pagination.= "$lastpage | ";
}
else
{
$pagination.= "1 | ";
$pagination.= "2 | ";
$pagination.= "... | ";
for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++)
{
if($counter == $page)
{
$pagination.= "$counter | ";
}
else
{
$pagination.= "$counter | ";
}
}
}
}
if($page < $counter - 1)
{
$pagination.= "volgende »";
}
else
{
$pagination.= "volgende »";
}
}
?>
echo $pagination; ?>
}
?> if($_SERVER['PHP_SELF']!='/www.desterren_old.net/index.php' && $_SERVER['PHP_SELF']!='/index.php'){ ?>
if($_SERVER['PHP_SELF']=="/inc/footer.php"){ die("U heeft hier geen toegang."); } ?>
if(($_SERVER['PHP_SELF']!="/zoek.php" && $_SERVER['PHP_SELF']!="/forum.php") OR isset($show_right)){ ?>
if($_SERVER['PHP_SELF']=="/forum.php")
{
?>
include 'inc/astropic.php'; ?>
include 'inc/magazines.php'; ?>
}
else
{
?>
include 'inc/twitter.php'; ?>
include 'inc/astropic.php'; ?>
include 'inc/populaire-berichten.php'; ?>
include 'inc/magazines.php'; ?>
include 'inc/laatste-berichten.php'; ?>
include 'inc/adsense-big.php'; ?>
}
?>
} ?>
} else { ?> } ?>
include 'inc/bottom-links.php'; ?>
include 'inc/stats.php'; ?>